<div class="page-header">
  <span>{{widget_title}}</span>
  <button class="btn btn-xs btn-success pull-right" style="margin-top: 14.5px;" ng-click="editOrAdd('add')"> 登记证书 </button>
  <div class="clearfix"></div>
</div>
<table class="table table-hover table-bordered" >
  <thead>
    <tr>
      <th>序号</th>
      <th>员工姓名</th>
      <th>证书类型</th>
      <th>证书编号</th>
      <th>过期日期</th>
      <th>证书状态</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>
    <tr ng-repeat-start="certificate in certificates">
      <td rowspan="{{certificate.papers.length}}">{{$index + 1}}</td>
      <td rowspan="{{certificate.papers.length}}">{{certificate.employee.name}}</td>
      <td>{{certificate.papers[0].paper_type.name}} </td>
      <td>{{certificate.papers[0].paper_no}}</td>
      <td>{{certificate.papers[0].due_date}}</td>
      <td>{{certificate.papers[0].state | translate}}</td>
      <td>
        <a class="btn btn-xs btn-info" ng-click="editOrAdd('edit', certificate.papers[0].id)">修改</a>
        <a class="btn btn-xs btn-danger" confirm-click agree-callback="deleteCertificate(certificate.papers[0].id)"> 删除 </a>
      </td>
    </tr>
    <tr ng-repeat-end ng-repeat="paper in certificate.papers.slice(1)">
      <td>{{paper.paper_type.name}} </td>
      <td>{{paper.paper_no}}</td>
      <td>{{paper.due_date}}</td>
      <td>{{paper.state | translate}}</td>
      <td>
        <a class="btn btn-xs btn-info" ng-click="editOrAdd('edit', paper.id)">修改</a>
        <a class="btn btn-xs btn-danger" confirm-click agree-callback="deleteCertificate(paper.id)"> 删除 </a>
      </td>
    </tr>
  </tbody>
</table>
